$OpenBSD: patch-Makefile_in,v 1.1.1.1 2016/01/01 11:54:26 bentley Exp $
--- Makefile.in.orig	Sun Dec 20 01:29:34 2015
+++ Makefile.in	Sun Dec 20 01:29:56 2015
@@ -613,11 +613,12 @@ $(PREFIX1).mode: modes.xml
 
 install-data-local:
 	apertium-gen-modes modes.xml apertium-$(PREFIX1)
-	$(INSTALL_DATA) $(PREFIX1).mode $(apertium_eu_modesdir)
-	$(INSTALL_DATA) $(BASENAME).$(PREFIX1).t1x $(BASENAME).$(PREFIX1).t2x $(apertium_eu_esdir)
-	$(INSTALL_DATA) $(BASENAME).$(PREFIX1).t3x $(apertium_eu_esdir)
-	$(INSTALL_DATA) $(BASENAME).ordinals.t1x $(apertium_eu_esdir)
-	$(INSTALL_DATA) $(BASENAME).colloc.t1x $(apertium_eu_esdir)
+	test -d $(DESTDIR)$(apertium_eu_modesdir) || mkdir $(DESTDIR)$(apertium_eu_modesdir)
+	$(INSTALL_DATA) $(PREFIX1).mode $(DESTDIR)$(apertium_eu_modesdir)
+	$(INSTALL_DATA) $(BASENAME).$(PREFIX1).t1x $(BASENAME).$(PREFIX1).t2x $(DESTDIR)$(apertium_eu_esdir)
+	$(INSTALL_DATA) $(BASENAME).$(PREFIX1).t3x $(DESTDIR)$(apertium_eu_esdir)
+	$(INSTALL_DATA) $(BASENAME).ordinals.t1x $(DESTDIR)$(apertium_eu_esdir)
+	$(INSTALL_DATA) $(BASENAME).colloc.t1x $(DESTDIR)$(apertium_eu_esdir)
 	cp *.mode modes/
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
